package com.lsy.renameAssistant;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Tag(name = "rename")
@RestController
@RequestMapping("/rename")
public class RenameController {
    @Autowired
    private RenameAgent renameAgent;



//    private static final String DB_URL = "jdbc:mysql://117.149.210.219:3306/ra_base_analysis?serverTimezone=UTC";
//    private static final String DB_USER = "base_analysis_dify";
//    private static final String DB_PASSWORD = "base_analysis_dify";



    private static final String DB_URL = "jdbc:mysql://10.102.12.52:3306/dbgpt_company?serverTimezone=UTC";
    private static final String DB_USER = "root";
    private static final String DB_PASSWORD = "rarb66886688";



    @Operation(summary = "对话")
    @PostMapping("/chat")
    public String chat(@RequestBody ChatForm chatForm) {


        String chat = renameAgent.chat(chatForm.getMemoryId(), chatForm.getMessage());
        return chat;
    }





}